<template>
  <div class="about">
    <input type="number" v-model="father">
    <button @click="passMoney">转账</button>
    <span>父收到子的消息：{{sonValue}}</span>
    <CallFather :msg="money" @comfire="msgMethod"></CallFather>
    <!-- <h1>欢迎来到对抗路:</h1>
    <input v-model="father" />
    //用子
    <div style="width:auto">
      <inputC :msg="father"/>
    </div> -->
  </div>
</template>
<script>
//声子
import CallFather from"@/components/input component/callFather.vue";
import inputC from"@/components/input component/inputC.vue";
import SonComp from '@/components/input component/sonComp.vue';
export default{
  data(){
    return {
      father:"初始值",
      sonValue:"",
      money:0
    }
  },
  //挂子
  components: {SonComp,CallFather} ,
    // inputC:inputC,
    methods:{
      passMoney(){
        this.money=this.father
      },
      msgMethod(value){
        console.log(value);
        this.sonValue = value;
      }
    }
  

};
</script>
